<%@include file="header.jsp"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>

<div class="alert alert-error"
	<%String errorStyle = "";
			if (request.getParameter("error") == null)
				errorStyle = "style='display: none;'";
			else
				errorStyle = "style='display: block;'";
			String errors = "Username or password is incorrect. Check it and try again.";%>
	<%=errorStyle%>><%=errors%></div>
<form id="singinForm" commandName="login" class="form-horizontal"
	action="<spring:url value="j_spring_security_check" />" method="post">
	<h2 class="form-signin-heading">Log In</h2>
	<hr><div class="control-group">
		<label class="control-label" for="j_username">Username</label>
		<div class="controls">
			<input type="text" path="login" id="j_username" name="j_username" class="required" placeholder="Username" />
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="j_password">Password</label>
		<div class="controls">
			<input type="password" path="password" id="j_password" name="j_password" class="required" placeholder="Password" /> 
		</div>
	</div>
	<div class="control-group">
		<label class="checkbox">
		<div class="controls">
			<input type="checkbox" name="j_remember" value="1" id="j_remember"> Remember me <br>
			<a class="input-block-level" href="register.html">
				Don't have an account? 
			</a>
		</div>
	</div>
	<div class="control-group">
		<div class="controls">
			<button class="btn btn-large btn-primary" type="submit">
				Sign in
			</button>
		</div>
	</div>
	
</form>
<script src="<spring:url value="/web/js/jquery-2.0.0.js" />"></script>
<script src="<spring:url value="/web/js/jquery.validate.js" />"></script>
<script src="<spring:url value="/web/js/bootstrap.js" />"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#singinForm").validate();
	});
</script>
<%@include file="footer.jsp"%>
